package com.taxi.management.service.Impl;

import com.taxi.management.dao.DriverDao;
import com.taxi.management.entity.DriverEntity;
import com.taxi.management.service.DriverService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DriverServiceImpl implements DriverService {

    @Resource
    private DriverDao driverDao;

    @Override
    public List<DriverEntity> getAllDriver(){
        return driverDao.getAllDriver();
    }

    @Override
    public DriverEntity getDriverById(int id) {
        return driverDao.getDriverById(id);
    }

    @Override
    public int addDriver(DriverEntity driver) {
        return driverDao.addDriver(driver);
    }

    @Override
    public int updateDriver(DriverEntity driver) {
        return driverDao.updateDriver(driver);
    }

    @Override
    public int deleteDriver(int id) {
        return driverDao.deleteDriver(id);
    }

    @Override
    public List<DriverEntity> getDriverByPage(String username, int start, int limit) {
        return driverDao.getDriverByPage(username, start, limit);
    }

}
